<?php

	function isEmpty($obj) {
		return (trim($obj)=='');
	}

	function isValidEmail($email) 
	{
	   return ereg("^[^@ ]+@[^@ ]+\.[^@ ]+$", $email);
	}
	
	function validCredentials($user,$func) {
		global $CREDENTIALS;
		if (!isset($user) or $user==null) {
			return false;
		} else {
			$arr = $CREDENTIALS[$user->groupid];
			if ($func=='') return true;
			return in_array($func,$arr);
		}
	}
	
	function saveCookie($var, $value) {
		setcookie($var,$value,time()+((COOKIE_EXPIRE*24)*60*60));
	}
	
?>
